package com.hui.jwt.config;

import com.hui.jwt.interceptors.JWTInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @BelongsProject: demo
 * @BelongsPackage: com.hui.jwt.config
 * @Author: HUI
 * @CreateTime: 2022-03-31 23:40
 * @Description: 配置拦截器
 */
public class InterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new JWTInterceptor())
                .addPathPatterns("/user/test")
                .excludePathPatterns("/user/login")
        ;
    }
}
